package com.example.hrmsaas.system.utils;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;


/**
 *
 *树节点的封装类
 */
@Data
@NoArgsConstructor //空构造方法注解
public class TreeNode {
    private Integer id;
    private Integer pid;
    private String title;
    private String icon;
    private String href;
    private Boolean spread;
    private Integer parentId;
    private String checkArr="0";

    private List<TreeNode> children = new ArrayList<>();

    /**
     * 菜单json的构造方法
     * @param id
     * @param pid
     * @param title
     * @param icon
     * @param href
     * @param spread
     */
    public TreeNode(Integer id, Integer pid, String title, String icon, String href, Boolean spread) {
        super();
        this.id = id;
        this.pid = pid;
        this.title = title;
        this.icon = icon;
        this.href = href;
        this.spread = spread;
    }

    public TreeNode(Integer id, Integer parentId, String title, Boolean spread) {
        super();
        this.id = id;
        this.parentId = parentId;
        this.title = title;
        this.spread = spread;
    }

    public TreeNode(Integer id, Integer pid, String title, Boolean spread, String checkArr) {
        super();
        this.id = id;
        this.pid = pid;
        this.parentId = pid;
        this.title = title;
        this.spread = spread;
        this.checkArr = checkArr;
    }
}



